package com.myl.core.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.myl.core.basic.BaseEntity;

import java.io.Serializable;
import java.time.LocalDateTime;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author Myl <ixiaomu@qq.com>
 * @since 2024-01-10 11:21
 */
@Data
@Accessors(chain = true)
@TableName("myl_user")
@Schema(name = "User", description = "用户表")
public class User extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @Schema(description = "登录账号")
    @TableField("username")
    private String username;

    @Schema(description = "密码")
    @TableField("password")
    private String password;

    @Schema(description = "昵称")
    @TableField("nickname")
    private String nickname;

    @Schema(description = "头像")
    @TableField("avatar")
    private Integer avatar;

    @Schema(description = "手机号")
    @TableField("mobile")
    private String mobile;

    @Schema(description = "邮箱地址")
    @TableField("email")
    private String email;

    @Schema(description = "手机已验证0否1是")
    @TableField("mobile_ckd")
    private Byte mobileCkd;

    @Schema(description = "邮箱已验证0否1是")
    @TableField("email_ckd")
    private Byte emailCkd;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("last_time")
    private LocalDateTime lastTime;

    @Schema(description = "上次登录ip")
    @TableField("last_ip")
    private String lastIp;

    @Schema(description = "是否可以登录后台")
    @TableField("is_admin")
    private Byte isAdmin;
}
